/*
 * Copyright (C) 2012 haru Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.harusource.di.core.activity;

import com.harusource.di.core.HaruCore;
import com.harusource.di.util.HaruUtil;

import android.app.ExpandableListActivity;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
import android.widget.SimpleExpandableListAdapter;

public abstract class HaruExpandableListActivity extends ExpandableListActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
        HaruCore.init(getApplicationContext());
        HaruCore.injectEvent(getApplicationContext(), this);
        HaruCore.injectFeild(getApplicationContext(), this);
    }
    @Override
    public void setContentView(int layoutResID) {
        super.setContentView(layoutResID);
        
        HaruCore.injectEvent(getApplicationContext(), this);
        HaruCore.injectFeild(getApplicationContext(), this);
    }
    @Override
    public void setContentView(View view) {
        super.setContentView(view);
        
        HaruCore.injectEvent(getApplicationContext(), this);
        HaruCore.injectFeild(getApplicationContext(), this);
    }
    @Override
    public void setContentView(View view, LayoutParams params) {
        super.setContentView(view, params);
        
        HaruCore.injectEvent(getApplicationContext(), this);
        HaruCore.injectFeild(getApplicationContext(), this);
    }
    
    public SimpleExpandableListAdapter getSimpleExpandableListAdapter(
            String[] group_data, int group_layout, int group_text_id, String[][][] child_data,
            int child_layout, int[] child_text_id) {
        return HaruUtil.getSimpleExpandableListAdapter(this, group_data, group_layout, group_text_id, child_data, child_layout, child_text_id);
    }
    
    public SimpleExpandableListAdapter getSimpleExpandableListAdapter(String[] group_data, String[][][] child_data)
    {
        return HaruUtil.getSimpleExpandableListAdapter(this, group_data, child_data);
    }
}
